package com.zy.design.pattern.adapter.extend;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zhaoyi
 * @date 2021/4/14 16:42
 * 模拟memcache缓存数据
 */
public class MemCache {

    private Map<String,Object> map = new HashMap<>();

    public void put(String key,Object val){
        map.put(key,val);
        System.out.println("memcache 插入 " + key + " 数据 " + val);
    }

    public Object get(String Key){
        System.out.println("memcache 查询数据");
        return map.get(Key);
    }

}
